package com.sos.repository;

import com.sos.model.entity.HelperInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface HelperInfoRepository extends JpaRepository<HelperInfo, Long> {
    List<HelperInfo> findByOnlineStatus(Integer onlineStatus);
    
    @Query("SELECT h FROM HelperInfo h WHERE h.userId IN :userIds AND h.onlineStatus = :onlineStatus")
    List<HelperInfo> findByUserIdInAndOnlineStatus(@Param("userIds") List<Long> userIds, @Param("onlineStatus") Integer onlineStatus);
    
    HelperInfo findByUserId(Long userId);
}